package com.happyghost.javapattern.decorator;

public class DecoratorMainTest {

    public static void main(String[] args) {
        System.out.println("原来没有录音功能");
        Phone phone = new TelePhone();
        phone.callOut("Hello girl !");

        System.out.println("\n\n");

        System.out.println("经过装饰后的phone有录音功能==");
        Phone phoneWithRecorder = new PhoneRecordDecorator(phone);
        phoneWithRecorder.callOut("Hello girl !");


        //测试发送短信功能

        System.out.println("\n\n");

        System.out.println("测试发送短信功能==");
        Phone phoneMessage = new PhoneMessageDecorator(phone);
        ((PhoneMessageDecorator) phoneMessage).sendMessage("1111");
    }
}
